Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][Personal] TypeOf over multiple types. #21034

Closed
wants to merge 11 commits into from

Conversation

AdamSpeight2008
Copy link
Contributor

This an experimental work in progress.
Proposal TypeOf Many.

  • Parser
dim result = TypeOf obj Is {T0, T1, T2 }
dim result = TypeOf obj IsNot {T0, T1, T2 }
  • SyntaxNodes
  • Binding
  • Lowering
  • Compilation

`Grammar:= { TypeName (, TypeName )* }`
Added a new SyntaxNode TypeArray that inherit TypeSyntax.
Refining the parser.
Add text to resource.resx
Updated the PublicAPI.Unshipped.
---
Note: Fails at binding stage.
Broken parsing of `TypeOf obj Is type`.
Fixing the parsing.
NOTE: error throw when hove over a type within array.
```
---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
Unexpected TypeArray syntax does not have diagnostics

   at Microsoft.CodeAnalysis.VisualBasic.Binder.BindExpression(ExpressionSyntax node, Boolean isInvocationOrAddressOf, Boolean isOperandOfConditionalBranch, Boolean eventContext, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.VisualBasic.Binder.BindNamespaceOrTypeOrExpressionSyntaxForSemanticModel(ExpressionSyntax node, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.VisualBasic.VBSemanticModel.Bind(Binder binder, SyntaxNode node, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GetBoundNodes(SyntaxNode node)
   at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GetLowerBoundNode(VisualBasicSyntaxNode node)
   at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GetBoundNodeSummary(VisualBasicSyntaxNode node)
   at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GetExpressionTypeInfo(ExpressionSyntax node, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysi......
<truncated>
```
@AdamSpeight2008
Copy link
Contributor Author

How do I initiate the lowering aspects of the compilation? My breakpoints are not being hit.

@Pilchie Pilchie added the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label Jul 25, 2017
@jcouv jcouv added Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee. labels Aug 1, 2017
@AdamSpeight2008 AdamSpeight2008 changed the title [Personal] TypeOf over multiple types. [WIP][Personal] TypeOf over multiple types. Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers cla-already-signed Community The pull request was submitted by a contributor who is not a Microsoft employee. PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants